package cn.xianshu.user.service.impl;

import cn.xianshu.basic.service.impl.BasicServiceImpl;
import cn.xianshu.basic.util.PageList;
import cn.xianshu.user.domain.Logininfo;
import cn.xianshu.user.mapper.LogininfoMapper;
import cn.xianshu.user.query.LogininfoQuery;
import cn.xianshu.user.service.ILogininfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LogininfoServiceImpl extends BasicServiceImpl<Logininfo> implements ILogininfoService {
    @Autowired
    private LogininfoMapper logininfoMapper;

    @Override
    public PageList<Logininfo> pageQuery(LogininfoQuery query) {
        // 查询总条数
        Integer total = logininfoMapper.count(query);
        // 每页显示数据
        List<Logininfo> rows = logininfoMapper.queryData(query);
        return new PageList<>(total, rows);
    }
}